feat(redact): replace gitleaks with betterleaks for secret detection#760
Merged
feat(redact): replace gitleaks with betterleaks for secret detection#760
Conversation
Betterleaks is a drop-in replacement by the gitleaks author with expanded rules (241 vs 223) and active development. The detect API is identical (NewDetectorDefaultConfig, DetectString, Finding.Secret), so this is a pure dependency + naming swap with no logic changes. Closes #756 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: e9bf2a2ffc9f
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Entire’s redaction secret-scanning dependency from gitleaks to betterleaks (a maintained drop-in replacement by the original author) and refreshes related references.
Changes:
- Swap
github.com/zricethezav/gitleaks/v8/detectforgithub.com/betterleaks/betterleaks/detectand rename related detector globals. - Update docs/tests wording to reference betterleaks.
- Update
go.mod/go.sumto reflect the new module graph.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
redact/redact.go |
Switch detector import and rename cached detector variables; update comments to reference betterleaks. |
redact/redact_test.go |
Update test comment to reference betterleaks. |
go.mod |
Add betterleaks direct dependency; remove gitleaks; indirect dependency graph changes. |
go.sum |
Update checksums to match the new dependency graph. |
docs/security-and-privacy.md |
Update security docs to reference betterleaks instead of gitleaks. |
New transitive dependency github.com/mikelolasagasti/xz (via betterleaks -> mholt/archives) uses the 0BSD license. 0BSD is a permissive public-domain-equivalent license. Refs: #756 Entire-Checkpoint: b627e9d2cb4f
Contributor
Author
|
@BugBot review |
Soph
approved these changes
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Betterleaks is a drop-in replacement by the gitleaks author with expanded rules (241 vs 223) and active development. The detect API is identical (NewDetectorDefaultConfig, DetectString, Finding.Secret), so this is a pure dependency + naming swap with no logic changes.
Closes #756
Note
Medium Risk
Updates the CLI’s secret redaction dependency, which is security-sensitive and could change what gets flagged/redacted (false positives/negatives) despite the API being drop-in compatible.
Overview
Switches pattern-based secret detection in
redactfromgitleakstobetterleaks, updating the detector wiring and corresponding test/documentation wording.Updates dependency manifests (
go.mod/go.sum) to addbetterleaksand refresh related transitive modules, and expands.allowed-licensesto include0BSD.Written by Cursor Bugbot for commit b8f369e. Configure here.